package psd.model.Prolog;

import java.util.Map;
import java.util.TreeMap;

public class LocalIDFQNTranslator
implements IFQNTranslator
{

Map fqnToIDTable;
private IIDGenerator provider;

public LocalIDFQNTranslator(LocalIDGenerator provider)
{
    fqnToIDTable = new TreeMap();
    this.provider = provider;
}

public Map getFQNMapping()
{
    return fqnToIDTable;
}

public String transformFQN(String string)
{
    string = string.replace('$', '.');
    Map map = fqnToIDTable;
   
    if(!fqnToIDTable.containsKey(string))
    {
        fqnToIDTable.put(string, provider.getID());
    }
    return (String)fqnToIDTable.get(string);
   }
}
